﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.WeiXin.DTO;
namespace Xproject.Util
{
    public class Cache_UserInfoModel
    {
        public static string CACHE_USERINFO_PRE = "CACHE_USERINFO_PRE_";
        public static void SetUserInfoModelCache(string key, UserInfoModel uModel)
        {
            System.Web.HttpRuntime.Cache.Insert(CACHE_USERINFO_PRE + key, uModel, null, DateTime.Now.AddHours(6), System.Web.Caching.Cache.NoSlidingExpiration);
        }

        public static UserInfoModel GetUserInfoModel(string key)
        {
           return System.Web.HttpRuntime.Cache[CACHE_USERINFO_PRE+key] as UserInfoModel;
        }

        public static void Clear(string key)
        {
            System.Web.HttpRuntime.Cache.Remove(CACHE_USERINFO_PRE+key);
        }
    }
}
